package com.chen.service.serviceimpl;

import com.chen.dao.StudentDao;
import com.chen.pojo.Absence;
import com.chen.pojo.MyAbsenceRecord;
import com.chen.pojo.Student;
import com.chen.pojo.User;
import com.chen.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentDao studentDao;

    @Override
    public List<Student> getStudentList(Student student) {
        return studentDao.getStudentList(student);
    }

    @Override
    public void deleteStudent(Integer id) {
        studentDao.deleteStudent(id);
    }

    @Override
    public Student getStudentById(Integer id) {
        return studentDao.getStudentById(id);
    }

    @Override
    public void updateStudent(Student student) {
        studentDao.updateStudent(student);
    }

    @Override
    public Student getStudentBySno(String sno) {
        return studentDao.getStudentBySno(sno);
    }

    @Override
    public void updateDormByStudentId(Student student) {
        studentDao.updateDormByStudentId(student);
    }

    @Override
    public List<MyAbsenceRecord> getMyAbsenceRecord(Absence absence) {
        return studentDao.getMyAbsenceRecord(absence);
    }

    @Override
    public void updatePassword(User user) {
        studentDao.updatePassword(user);
    }
}
